package lc.activiti.global;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import org.springframework.web.bind.annotation.ExceptionHandler;
import org.springframework.web.bind.annotation.ResponseBody;

//@Slf4j
//@ControllerAdvice
public class GlobalExceptionHandler {
	@ExceptionHandler(value = Exception.class)
	@ResponseBody
	public void defaultErrorHandler(Exception e, HttpServletRequest request, HttpServletResponse response) throws Exception {
//		String url = request.getRequestURL().toString();
//		String method = request.getMethod();
//		String uri = request.getRequestURI();
//		String queryString = request.getQueryString();
//		log.error("请求出现错误： 各个参数, url: {}, method: {}, uri: {}, params: {},错误:{}", url, method, uri, queryString,e);
//		//log.error(String.format("接口:【%s】出现错误:",request.getMethod()),e);
//		String rslt = JsonpUtils.getInstance().getFailJsonpResult("calback", "error", e.getMessage());
//		response.getWriter().write(rslt);
		//return rslt;
	}
}
